const { defineConfig } = require('@vue/cli-service')
const path = require('path')

module.exports = defineConfig({
  transpileDependencies: true,
  
  // 开发服务器配置
  devServer: {
    port: 5173,
    open: true,
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  
  // 路径别名配置
  configureWebpack: {
    resolve: {
      alias: {
        '@': path.resolve(__dirname, 'src')
      }
    }
  },
  
  // 生产环境配置
  productionSourceMap: false,
  
  // CSS配置
  css: {
    loaderOptions: {
      scss: {
        additionalData: `@use "@/styles/variables.scss" as *; @use 'sass:color';`
      }
    }
  }
})
// module.exports = {
//   devServer: {
//     port: 5173,// 自定义端口号
//   }
// }